﻿@{
    ViewData["Title"] = "Add";
    Layout = "~/Areas/Admin/Views/_Layout.cshtml";
}
<link href="~/lib/layui-select/formSelects-v4.css" rel="stylesheet" />
<div style="margin-top:3em;margin-right:5em">
    <form class="layui-form" action="">
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备份名称</label>
            <div class="layui-input-block">
                <input type="text" name="Name" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="Description" placeholder="请输入内容" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script>
    layui.use('form', function () {
        var form = layui.form;
        //监听提交
        form.on('submit(formDemo)', function (data) {
            BaseAjax(ajaxType.post, "/admin/database/add", data.field, function (repo) {
                if (repo.status == ajaxStatus.OK)
                  x_admin_close();
            })
            return false;
        });
    });
</script>
